package model.dao;

import java.sql.SQLException;
import java.util.ArrayList;
import java.util.HashMap;

import model.vo.movie.MovieVO;
import model.vo.movie.StaticsVO;

import com.ibatis.sqlmap.client.SqlMapClient;

public class MovieDao {
	private SqlMapClient sqlMapClient;

	public void setSqlMapClient(SqlMapClient sqlMapClient) {
		this.sqlMapClient = sqlMapClient;
	}
	/**
	 * 상영중인 영화
	 * 	 */
	public ArrayList<HashMap> getScreeningMovie() throws SQLException {
		return (ArrayList<HashMap>) sqlMapClient.queryForList("movie.getScreeningMovie");
	}
	/**
	 * 영화번호에 해당하는 영화정보 불러오기
	 */
	public MovieVO getMovieInfo(int movie_no) throws SQLException {
		return (MovieVO) sqlMapClient.queryForObject("movie.getMovieInfo",movie_no);
	}
	
	public ArrayList<HashMap> getUpcomingMovie() throws SQLException {
		return (ArrayList<HashMap>)sqlMapClient.queryForList("movie.getUpcomingMovie");
	}
	/**
	 * movie table에 등록된 전체 영화 정보 받아오기
	 * @throws SQLException 
	 */
	public ArrayList<HashMap> getAllMovieList() throws SQLException {
		return (ArrayList<HashMap>)sqlMapClient.queryForList("movie.getAllMovieList");
	}
	/**
	 * 5/8 추가
	 * @return
	 * @throws SQLException 
	 */
/*	public ArrayList<HashMap> getBoxOfficeList() throws SQLException {
		return (ArrayList<HashMap>)sqlMapClient.queryForList("movie.getBoxOfficeList");
	}*/
	/**
	 * 5/9수정
	 * @throws SQLException 
	 */
	public ArrayList<StaticsVO> getBeforeBoxUpdateRM() throws SQLException{
		return (ArrayList<StaticsVO>)sqlMapClient.queryForList("movie.getBeforeBoxUpdateRM");
	}
	public ArrayList<HashMap> getBoxOfficeList() throws SQLException {
		return (ArrayList<HashMap>) sqlMapClient.queryForList("movie.getBoxOfficeList");
	}
	//아영
	public ArrayList<MovieVO> getSearchMovieByTitle(String search_title) throws SQLException {
		return (ArrayList<MovieVO>) sqlMapClient.queryForList("movie.getSearchMovieByTitle",search_title);
	}
	//아영
	public ArrayList<MovieVO> getSearchMovieByGenre(String search_title) throws SQLException {
		return (ArrayList<MovieVO>) sqlMapClient.queryForList("movie.getSearchMovieByGenre",search_title);
	}
	//아영
	public ArrayList<MovieVO> getSearchMovieByCountry(String search_title) throws SQLException {
		return (ArrayList<MovieVO>) sqlMapClient.queryForList("movie.getSearchMovieByCountry",search_title);
	}
	public ArrayList<HashMap> getMainMovieList() throws SQLException {
		return (ArrayList<HashMap>)sqlMapClient.queryForList("movie.getMainMovieList");
	}
	public String dayCheck(int no) throws SQLException {
		return (String) sqlMapClient.queryForObject("movie.dayCheck",no);
	}
	public ArrayList<HashMap> searchMovie(String search_title) throws SQLException {
		return (ArrayList<HashMap>)sqlMapClient.queryForList("movie.searchMovie",search_title);
	}




	
	
}
